#ifndef  __THREAD_H__
#define  __THREAD_H__


#include "define.h"
#include "mempool.h"
#include "epoll_model.h"
#include "select_model.h"


#include<iostream>
#include<pthread.h>
#include<sys/prctl.h>


/**
 * @brief 线程的配置结构体;
 */
struct thread_conf_st
{
	int iPriority; //优先级;
	size_t uPthreadStackSize; //
	char * pPthreadSchePolicy; //策略;
};



//线程类;
class thread{
public:
	thread();
	virtual ~thread();
	int setPthreadAttr(size_t stacksize);
	int setPthreadBindCpuNo(int No);
	int setPthreadPriority(int priority);
	int setPthreadSchedulePolicy(int policy);
	virtual int init(void *arg) = 0;	
private:
	struct pthread_ctx  ctx;
};






#endif

